package day2.线程池.demo3;

public class MyTask implements Runnable{
    int work;
    MyTask(int work){
        this.work = work;
    }
    @Override
    public void run() {
        String name = Thread.currentThread().getName();
        System.out.println(name+"---------,开始任务："+work);
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(name+"*********,结束任务："+work);
    }
}
